package main;

import gui.GUI;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.event.KeyListener;
import java.awt.event.WindowListener;
import network.GameNetwork;




public class GameMain
{
   public static GUI GUI = null;

   public static void main(String[] args)
   {
      EventQueue.invokeLater(new Runnable() {
	 public void run()
	 {
	    try {
	       GUI = new GUI();
	    } catch (Exception e) {
	       System.err.println("Error when load GUI:");
	       e.printStackTrace();
	    }
	    
	    GameNetwork.INSTANCE.init();
	 }
      });
      
   }
   
   public static void addKeyListener(KeyListener keyListener)
   {
      GUI.addKeyListener(keyListener);
   }
   
   public static void addWindowListener(WindowListener windowListener)
   {
      GUI.addWindowListener(windowListener);
   }
   
   public static void addComponent(Component comp)
   {
      GUI.addComponent(comp);
   }
}